Integrand size = 38, antiderivative size = 99 \[ \int \frac {\cos (c+d x) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right )}{a+a \cos (c+d x)} \, dx=-\frac {(2 B-3 C) x}{2 a}+\frac {2 (B-C) \sin (c+d x)}{a d}-\frac {(2 B-3 C) \cos (c+d x) \sin (c+d x)}{2 a d}+\frac {(B-C) \cos ^2(c+d x) \sin (c+d x)}{d (a+a \cos (c+d x))} \]
-1/2*(2*B-3*C)*x/a+2*(B-C)*sin(d*x+c)/a/d-1/2*(2*B-3*C)*cos(d*x+c)*sin(d*x +c)/a/d+(B-C)*cos(d*x+c)^2*sin(d*x+c)/d/(a+a*cos(d*x+c))
Time = 1.13 (sec) , antiderivative size = 197, normalized size of antiderivative = 1.99 \[ \int \frac {\cos (c+d x) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right )}{a+a \cos (c+d x)} \, dx=\frac {\cos \left (\frac {1}{2} (c+d x)\right ) \sec \left (\frac {c}{2}\right ) \left (-4 (2 B-3 C) d x \cos \left (\frac {d x}{2}\right )-4 (2 B-3 C) d x \cos \left (c+\frac {d x}{2}\right )+20 B \sin \left (\frac {d x}{2}\right )-20 C \sin \left (\frac {d x}{2}\right )+4 B \sin \left (c+\frac {d x}{2}\right )-4 C \sin \left (c+\frac {d x}{2}\right )+4 B \sin \left (c+\frac {3 d x}{2}\right )-3 C \sin \left (c+\frac {3 d x}{2}\right )+4 B \sin \left (2 c+\frac {3 d x}{2}\right )-3 C \sin \left (2 c+\frac {3 d x}{2}\right )+C \sin \left (2 c+\frac {5 d x}{2}\right )+C \sin \left (3 c+\frac {5 d x}{2}\right )\right )}{8 a d (1+\cos (c+d x))} \]
(Cos[(c + d*x)/2]*Sec[c/2]*(-4*(2*B - 3*C)*d*x*Cos[(d*x)/2] - 4*(2*B - 3*C )*d*x*Cos[c + (d*x)/2] + 20*B*Sin[(d*x)/2] - 20*C*Sin[(d*x)/2] + 4*B*Sin[c + (d*x)/2] - 4*C*Sin[c + (d*x)/2] + 4*B*Sin[c + (3*d*x)/2] - 3*C*Sin[c + (3*d*x)/2] + 4*B*Sin[2*c + (3*d*x)/2] - 3*C*Sin[2*c + (3*d*x)/2] + C*Sin[2 *c + (5*d*x)/2] + C*Sin[3*c + (5*d*x)/2]))/(8*a*d*(1 + Cos[c + d*x]))
Time = 0.50 (sec) , antiderivative size = 98, normalized size of antiderivative = 0.99, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {3042, 3508, 3042, 3456, 3042, 3213}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\cos (c+d x) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right )}{a \cos (c+d x)+a} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\sin \left (c+d x+\frac {\pi }{2}\right ) \left (B \sin \left (c+d x+\frac {\pi }{2}\right )+C \sin \left (c+d x+\frac {\pi }{2}\right )^2\right )}{a \sin \left (c+d x+\frac {\pi }{2}\right )+a}dx\) |
\(\Big \downarrow \) 3508 |
\(\displaystyle \int \frac {\cos ^2(c+d x) (B+C \cos (c+d x))}{a \cos (c+d x)+a}dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\sin \left (c+d x+\frac {\pi }{2}\right )^2 \left (B+C \sin \left (c+d x+\frac {\pi }{2}\right )\right )}{a \sin \left (c+d x+\frac {\pi }{2}\right )+a}dx\) |
\(\Big \downarrow \) 3456 |
\(\displaystyle \frac {\int \cos (c+d x) (2 a (B-C)-a (2 B-3 C) \cos (c+d x))dx}{a^2}+\frac {(B-C) \sin (c+d x) \cos ^2(c+d x)}{d (a \cos (c+d x)+a)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \sin \left (c+d x+\frac {\pi }{2}\right ) \left (2 a (B-C)-a (2 B-3 C) \sin \left (c+d x+\frac {\pi }{2}\right )\right )dx}{a^2}+\frac {(B-C) \sin (c+d x) \cos ^2(c+d x)}{d (a \cos (c+d x)+a)}\) |
\(\Big \downarrow \) 3213 |
\(\displaystyle \frac {\frac {2 a (B-C) \sin (c+d x)}{d}-\frac {a (2 B-3 C) \sin (c+d x) \cos (c+d x)}{2 d}-\frac {1}{2} a x (2 B-3 C)}{a^2}+\frac {(B-C) \sin (c+d x) \cos ^2(c+d x)}{d (a \cos (c+d x)+a)}\) |
((B - C)*Cos[c + d*x]^2*Sin[c + d*x])/(d*(a + a*Cos[c + d*x])) + (-1/2*(a* (2*B - 3*C)*x) + (2*a*(B - C)*Sin[c + d*x])/d - (a*(2*B - 3*C)*Cos[c + d*x ]*Sin[c + d*x])/(2*d))/a^2
3.3.54.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.) *(x_)]), x_Symbol] :> Simp[(2*a*c + b*d)*(x/2), x] + (-Simp[(b*c + a*d)*(Co s[e + f*x]/f), x] - Simp[b*d*Cos[e + f*x]*(Sin[e + f*x]/(2*f)), x]) /; Free Q[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Sim p[(A*b - a*B)*Cos[e + f*x]*(a + b*Sin[e + f*x])^m*((c + d*Sin[e + f*x])^n/( a*f*(2*m + 1))), x] - Simp[1/(a*b*(2*m + 1)) Int[(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^(n - 1)*Simp[A*(a*d*n - b*c*(m + 1)) - B*(a*c*m + b*d*n) - d*(a*B*(m - n) + A*b*(m + n + 1))*Sin[e + f*x], x], x], x] /; Fre eQ[{a, b, c, d, e, f, A, B}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] & & NeQ[c^2 - d^2, 0] && LtQ[m, -2^(-1)] && GtQ[n, 0] && IntegerQ[2*m] && (In tegerQ[2*n] || EqQ[c, 0])
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_ .) + (f_.)*(x_)]^2), x_Symbol] :> Simp[1/b^2 Int[(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^n*(b*B - a*C + b*C*Sin[e + f*x]), x], x] /; FreeQ [{a, b, c, d, e, f, A, B, C, m, n}, x] && NeQ[b*c - a*d, 0] && EqQ[A*b^2 - a*b*B + a^2*C, 0]
Time = 1.66 (sec) , antiderivative size = 61, normalized size of antiderivative = 0.62
method | result | size |
parallelrisch | \(\frac {\left (C \cos \left (2 d x +2 c \right )+\left (4 B -2 C \right ) \cos \left (d x +c \right )+8 B -7 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-4 \left (-\frac {3 C}{2}+B \right ) x d}{4 a d}\) | \(61\) |
derivativedivides | \(\frac {B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) C -\frac {2 \left (\left (\frac {3 C}{2}-B \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {C}{2}-B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}-\left (2 B -3 C \right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}\) | \(105\) |
default | \(\frac {B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) C -\frac {2 \left (\left (\frac {3 C}{2}-B \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {C}{2}-B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}-\left (2 B -3 C \right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}\) | \(105\) |
risch | \(-\frac {B x}{a}+\frac {3 C x}{2 a}-\frac {i {\mathrm e}^{i \left (d x +c \right )} B}{2 a d}+\frac {i {\mathrm e}^{i \left (d x +c \right )} C}{2 a d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} B}{2 a d}-\frac {i {\mathrm e}^{-i \left (d x +c \right )} C}{2 a d}+\frac {2 i B}{d a \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}-\frac {2 i C}{d a \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}+\frac {\sin \left (2 d x +2 c \right ) C}{4 a d}\) | \(156\) |
norman | \(\frac {\frac {\left (B -C \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}+\frac {\left (3 B -2 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a d}+\frac {\left (5 B -6 C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}-\frac {\left (2 B -3 C \right ) x}{2 a}+\frac {7 \left (B -C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}-\frac {3 \left (2 B -3 C \right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a}-\frac {3 \left (2 B -3 C \right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a}-\frac {\left (2 B -3 C \right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}\) | \(198\) |
1/4*((C*cos(2*d*x+2*c)+(4*B-2*C)*cos(d*x+c)+8*B-7*C)*tan(1/2*d*x+1/2*c)-4* (-3/2*C+B)*x*d)/a/d
Time = 0.26 (sec) , antiderivative size = 83, normalized size of antiderivative = 0.84 \[ \int \frac {\cos (c+d x) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right )}{a+a \cos (c+d x)} \, dx=-\frac {{\left (2 \, B - 3 \, C\right )} d x \cos \left (d x + c\right ) + {\left (2 \, B - 3 \, C\right )} d x - {\left (C \cos \left (d x + c\right )^{2} + {\left (2 \, B - C\right )} \cos \left (d x + c\right ) + 4 \, B - 4 \, C\right )} \sin \left (d x + c\right )}{2 \, {\left (a d \cos \left (d x + c\right ) + a d\right )}} \]
-1/2*((2*B - 3*C)*d*x*cos(d*x + c) + (2*B - 3*C)*d*x - (C*cos(d*x + c)^2 + (2*B - C)*cos(d*x + c) + 4*B - 4*C)*sin(d*x + c))/(a*d*cos(d*x + c) + a*d )
Leaf count of result is larger than twice the leaf count of optimal. 668 vs. \(2 (80) = 160\).
Time = 1.08 (sec) , antiderivative size = 668, normalized size of antiderivative = 6.75 \[ \int \frac {\cos (c+d x) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right )}{a+a \cos (c+d x)} \, dx=\begin {cases} - \frac {2 B d x \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{2 a d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 4 a d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d} - \frac {4 B d x \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{2 a d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 4 a d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d} - \frac {2 B d x}{2 a d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 4 a d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d} + \frac {2 B \tan ^{5}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{2 a d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 4 a d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d} + \frac {8 B \tan ^{3}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{2 a d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 4 a d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d} + \frac {6 B \tan {\left (\frac {c}{2} + \frac {d x}{2} \right )}}{2 a d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 4 a d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d} + \frac {3 C d x \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{2 a d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 4 a d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d} + \frac {6 C d x \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{2 a d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 4 a d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d} + \frac {3 C d x}{2 a d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 4 a d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d} - \frac {2 C \tan ^{5}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{2 a d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 4 a d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d} - \frac {10 C \tan ^{3}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{2 a d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 4 a d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d} - \frac {4 C \tan {\left (\frac {c}{2} + \frac {d x}{2} \right )}}{2 a d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 4 a d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d} & \text {for}\: d \neq 0 \\\frac {x \left (B \cos {\left (c \right )} + C \cos ^{2}{\left (c \right )}\right ) \cos {\left (c \right )}}{a \cos {\left (c \right )} + a} & \text {otherwise} \end {cases} \]
Piecewise((-2*B*d*x*tan(c/2 + d*x/2)**4/(2*a*d*tan(c/2 + d*x/2)**4 + 4*a*d *tan(c/2 + d*x/2)**2 + 2*a*d) - 4*B*d*x*tan(c/2 + d*x/2)**2/(2*a*d*tan(c/2 + d*x/2)**4 + 4*a*d*tan(c/2 + d*x/2)**2 + 2*a*d) - 2*B*d*x/(2*a*d*tan(c/2 + d*x/2)**4 + 4*a*d*tan(c/2 + d*x/2)**2 + 2*a*d) + 2*B*tan(c/2 + d*x/2)** 5/(2*a*d*tan(c/2 + d*x/2)**4 + 4*a*d*tan(c/2 + d*x/2)**2 + 2*a*d) + 8*B*ta n(c/2 + d*x/2)**3/(2*a*d*tan(c/2 + d*x/2)**4 + 4*a*d*tan(c/2 + d*x/2)**2 + 2*a*d) + 6*B*tan(c/2 + d*x/2)/(2*a*d*tan(c/2 + d*x/2)**4 + 4*a*d*tan(c/2 + d*x/2)**2 + 2*a*d) + 3*C*d*x*tan(c/2 + d*x/2)**4/(2*a*d*tan(c/2 + d*x/2) **4 + 4*a*d*tan(c/2 + d*x/2)**2 + 2*a*d) + 6*C*d*x*tan(c/2 + d*x/2)**2/(2* a*d*tan(c/2 + d*x/2)**4 + 4*a*d*tan(c/2 + d*x/2)**2 + 2*a*d) + 3*C*d*x/(2* a*d*tan(c/2 + d*x/2)**4 + 4*a*d*tan(c/2 + d*x/2)**2 + 2*a*d) - 2*C*tan(c/2 + d*x/2)**5/(2*a*d*tan(c/2 + d*x/2)**4 + 4*a*d*tan(c/2 + d*x/2)**2 + 2*a* d) - 10*C*tan(c/2 + d*x/2)**3/(2*a*d*tan(c/2 + d*x/2)**4 + 4*a*d*tan(c/2 + d*x/2)**2 + 2*a*d) - 4*C*tan(c/2 + d*x/2)/(2*a*d*tan(c/2 + d*x/2)**4 + 4* a*d*tan(c/2 + d*x/2)**2 + 2*a*d), Ne(d, 0)), (x*(B*cos(c) + C*cos(c)**2)*c os(c)/(a*cos(c) + a), True))
Leaf count of result is larger than twice the leaf count of optimal. 225 vs. \(2 (95) = 190\).
Time = 0.29 (sec) , antiderivative size = 225, normalized size of antiderivative = 2.27 \[ \int \frac {\cos (c+d x) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right )}{a+a \cos (c+d x)} \, dx=-\frac {C {\left (\frac {\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {3 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}}{a + \frac {2 \, a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {a \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}}} - \frac {3 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} + \frac {\sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}\right )} + B {\left (\frac {2 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} - \frac {2 \, \sin \left (d x + c\right )}{{\left (a + \frac {a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )} {\left (\cos \left (d x + c\right ) + 1\right )}} - \frac {\sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}\right )}}{d} \]
-(C*((sin(d*x + c)/(cos(d*x + c) + 1) + 3*sin(d*x + c)^3/(cos(d*x + c) + 1 )^3)/(a + 2*a*sin(d*x + c)^2/(cos(d*x + c) + 1)^2 + a*sin(d*x + c)^4/(cos( d*x + c) + 1)^4) - 3*arctan(sin(d*x + c)/(cos(d*x + c) + 1))/a + sin(d*x + c)/(a*(cos(d*x + c) + 1))) + B*(2*arctan(sin(d*x + c)/(cos(d*x + c) + 1)) /a - 2*sin(d*x + c)/((a + a*sin(d*x + c)^2/(cos(d*x + c) + 1)^2)*(cos(d*x + c) + 1)) - sin(d*x + c)/(a*(cos(d*x + c) + 1))))/d
Time = 0.28 (sec) , antiderivative size = 124, normalized size of antiderivative = 1.25 \[ \int \frac {\cos (c+d x) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right )}{a+a \cos (c+d x)} \, dx=-\frac {\frac {{\left (d x + c\right )} {\left (2 \, B - 3 \, C\right )}}{a} - \frac {2 \, {\left (B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{a} - \frac {2 \, {\left (2 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 3 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 2 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{2} a}}{2 \, d} \]
-1/2*((d*x + c)*(2*B - 3*C)/a - 2*(B*tan(1/2*d*x + 1/2*c) - C*tan(1/2*d*x + 1/2*c))/a - 2*(2*B*tan(1/2*d*x + 1/2*c)^3 - 3*C*tan(1/2*d*x + 1/2*c)^3 + 2*B*tan(1/2*d*x + 1/2*c) - C*tan(1/2*d*x + 1/2*c))/((tan(1/2*d*x + 1/2*c) ^2 + 1)^2*a))/d
Time = 1.47 (sec) , antiderivative size = 107, normalized size of antiderivative = 1.08 \[ \int \frac {\cos (c+d x) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right )}{a+a \cos (c+d x)} \, dx=\frac {\left (2\,B-3\,C\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (2\,B-C\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+2\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+a\right )}-\frac {x\,\left (2\,B-3\,C\right )}{2\,a}+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (B-C\right )}{a\,d} \]